package com.kelaite.procurement.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.kelaite.procurement.entity.TCompany;
import com.kelaite.procurement.entity.TMaterialMasterClient;

public interface MaterialMasterClientRepository extends
		JpaRepository<TMaterialMasterClient, Long> {

	public List<TMaterialMasterClient> findByTCompany(TCompany tCompany);

	@Query(value = "select count(*) from t_material_master_client where material_name =?1 and company_id =?2", nativeQuery = true)
	public int countByMaterialNameAndCompanyId(String materialName,
			Long companyId);
}
